package com.example.service;

import com.example.entity.Review;
import com.example.mapper.ReviewMapper;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.time.LocalDate;
import java.time.LocalDateTime;

@Service
public class ReviewService {
    @Resource
    private ReviewMapper reviewMapper;

    public void createReview(Review review) {
        review.setReviewTime(LocalDateTime.now());
        reviewMapper.createReview(review);
    }

    public Review selectByOrderNo(String orderNo) {
        return reviewMapper.selectByOrderNo(orderNo);
    }
}
